package com.j256.ormlite.field.types;

import com.j256.ormlite.field.FieldType;
import com.j256.ormlite.field.SqlType;
import com.j256.ormlite.support.DatabaseResults;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.SQLException;

public class SerializableType extends BaseDataType
{
  private static final SerializableType singleTon = new SerializableType();

  private SerializableType()
  {
    super(SqlType.SERIALIZABLE, new Class[0]);
  }

  protected SerializableType(SqlType paramSqlType, Class<?>[] paramArrayOfClass)
  {
    super(paramSqlType, paramArrayOfClass);
  }

  public static SerializableType getSingleton()
  {
    return singleTon;
  }

  public Class<?> getPrimaryClass()
  {
    return Serializable.class;
  }

  public boolean isAppropriateId()
  {
    return false;
  }

  public boolean isArgumentHolderRequired()
  {
    return true;
  }

  public boolean isComparable()
  {
    return false;
  }

  public boolean isStreamType()
  {
    return true;
  }

  public boolean isValidForField(Field paramField)
  {
    return Serializable.class.isAssignableFrom(paramField.getType());
  }

  // ERROR //
  public Object javaToSqlArg(FieldType paramFieldType, Object paramObject)
    throws SQLException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_3
    //   2: new 56	java/io/ByteArrayOutputStream
    //   5: dup
    //   6: invokespecial 57	java/io/ByteArrayOutputStream:<init>	()V
    //   9: astore 4
    //   11: new 59	java/io/ObjectOutputStream
    //   14: dup
    //   15: aload 4
    //   17: invokespecial 62	java/io/ObjectOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   20: astore 5
    //   22: aload 5
    //   24: aload_2
    //   25: invokevirtual 66	java/io/ObjectOutputStream:writeObject	(Ljava/lang/Object;)V
    //   28: aload 5
    //   30: invokevirtual 69	java/io/ObjectOutputStream:close	()V
    //   33: aconst_null
    //   34: astore_3
    //   35: aload 4
    //   37: invokevirtual 73	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   40: astore 9
    //   42: iconst_0
    //   43: ifeq +7 -> 50
    //   46: aconst_null
    //   47: invokevirtual 69	java/io/ObjectOutputStream:close	()V
    //   50: aload 9
    //   52: areturn
    //   53: astore 6
    //   55: new 75	java/lang/StringBuilder
    //   58: dup
    //   59: invokespecial 76	java/lang/StringBuilder:<init>	()V
    //   62: ldc 78
    //   64: invokevirtual 82	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   67: aload_2
    //   68: invokevirtual 85	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   71: invokevirtual 89	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   74: aload 6
    //   76: invokestatic 95	com/j256/ormlite/misc/SqlExceptionUtil:create	(Ljava/lang/String;Ljava/lang/Throwable;)Ljava/sql/SQLException;
    //   79: athrow
    //   80: astore 7
    //   82: aload_3
    //   83: ifnull +7 -> 90
    //   86: aload_3
    //   87: invokevirtual 69	java/io/ObjectOutputStream:close	()V
    //   90: aload 7
    //   92: athrow
    //   93: astore 10
    //   95: aload 9
    //   97: areturn
    //   98: astore 8
    //   100: goto -10 -> 90
    //   103: astore 7
    //   105: aload 5
    //   107: astore_3
    //   108: goto -26 -> 82
    //   111: astore 6
    //   113: aload 5
    //   115: astore_3
    //   116: goto -61 -> 55
    //
    // Exception table:
    //   from	to	target	type
    //   2	22	53	java/lang/Exception
    //   35	42	53	java/lang/Exception
    //   2	22	80	finally
    //   35	42	80	finally
    //   55	80	80	finally
    //   46	50	93	java/io/IOException
    //   86	90	98	java/io/IOException
    //   22	33	103	finally
    //   22	33	111	java/lang/Exception
  }

  public Object parseDefaultString(FieldType paramFieldType, String paramString)
    throws SQLException
  {
    throw new SQLException("Default values for serializable types are not supported");
  }

  public Object resultStringToJava(FieldType paramFieldType, String paramString, int paramInt)
    throws SQLException
  {
    throw new SQLException("Serializable type cannot be converted from string to Java");
  }

  public Object resultToSqlArg(FieldType paramFieldType, DatabaseResults paramDatabaseResults, int paramInt)
    throws SQLException
  {
    return paramDatabaseResults.getBytes(paramInt);
  }

  // ERROR //
  public Object sqlArgToJava(FieldType paramFieldType, Object paramObject, int paramInt)
    throws SQLException
  {
    // Byte code:
    //   0: aload_2
    //   1: checkcast 118	[B
    //   4: checkcast 118	[B
    //   7: astore 4
    //   9: aconst_null
    //   10: astore 5
    //   12: new 120	java/io/ObjectInputStream
    //   15: dup
    //   16: new 122	java/io/ByteArrayInputStream
    //   19: dup
    //   20: aload 4
    //   22: invokespecial 125	java/io/ByteArrayInputStream:<init>	([B)V
    //   25: invokespecial 128	java/io/ObjectInputStream:<init>	(Ljava/io/InputStream;)V
    //   28: astore 6
    //   30: aload 6
    //   32: invokevirtual 132	java/io/ObjectInputStream:readObject	()Ljava/lang/Object;
    //   35: astore 10
    //   37: aload 6
    //   39: ifnull +8 -> 47
    //   42: aload 6
    //   44: invokevirtual 133	java/io/ObjectInputStream:close	()V
    //   47: aload 10
    //   49: areturn
    //   50: astore 7
    //   52: new 75	java/lang/StringBuilder
    //   55: dup
    //   56: invokespecial 76	java/lang/StringBuilder:<init>	()V
    //   59: ldc 135
    //   61: invokevirtual 82	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   64: aload 4
    //   66: invokestatic 140	java/util/Arrays:toString	([B)Ljava/lang/String;
    //   69: invokevirtual 82	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   72: ldc 142
    //   74: invokevirtual 82	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   77: aload 4
    //   79: arraylength
    //   80: invokevirtual 145	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
    //   83: ldc 147
    //   85: invokevirtual 82	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   88: invokevirtual 89	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   91: aload 7
    //   93: invokestatic 95	com/j256/ormlite/misc/SqlExceptionUtil:create	(Ljava/lang/String;Ljava/lang/Throwable;)Ljava/sql/SQLException;
    //   96: athrow
    //   97: astore 8
    //   99: aload 5
    //   101: ifnull +8 -> 109
    //   104: aload 5
    //   106: invokevirtual 133	java/io/ObjectInputStream:close	()V
    //   109: aload 8
    //   111: athrow
    //   112: astore 11
    //   114: aload 10
    //   116: areturn
    //   117: astore 9
    //   119: goto -10 -> 109
    //   122: astore 8
    //   124: aload 6
    //   126: astore 5
    //   128: goto -29 -> 99
    //   131: astore 7
    //   133: aload 6
    //   135: astore 5
    //   137: goto -85 -> 52
    //
    // Exception table:
    //   from	to	target	type
    //   12	30	50	java/lang/Exception
    //   12	30	97	finally
    //   52	97	97	finally
    //   42	47	112	java/io/IOException
    //   104	109	117	java/io/IOException
    //   30	37	122	finally
    //   30	37	131	java/lang/Exception
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.j256.ormlite.field.types.SerializableType
 * JD-Core Version:    0.6.2
 */